package com.ruofeng.app.kotlin.common.dsl.`fun`

import com.fasterxml.jackson.databind.ObjectMapper
import org.junit.Test

/**
 * Created by 邱鹏 on 2017/8/25.
 */
open class TestFun {
    @Test
    fun testFunDsl() {
        var first = http {
            url = "dd"
        }
        var result = ObjectMapper().writeValueAsString(first)
        println(result)
    }
}

fun http(init: Request.() -> Unit) {
    val wrap = Request()
    wrap.init()
}

class Request {
    var url: String = ""
    fun success(str: String) {

    }
}